package cn.sheep.dmp.tags

import org.apache.commons.lang3.StringUtils
import org.apache.spark.sql.Row

/**
  * sheep.Old @ 64341393
  * Created 2018/4/1
  */
object Tags4Area extends Tags{
    override def makeTags(args: Any*): Map[String, Int] = {
        var map = Map[String, Int]()

        val row = args(0).asInstanceOf[Row]

        // 地域标签
        val pName = row.getAs[String]("provincename")
        val cName = row.getAs[String]("cityname")

        if (StringUtils.isNotEmpty(pName)) map += "ZP"+pName -> 1
        if (StringUtils.isNotEmpty(cName)) map += "ZC"+cName -> 1

        map
    }
}
